<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${key.prePayOffse }</title>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/global.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx }/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">

	var curHouseId=null;  //房屋id
	var curAccountId=null; //帐户id

	//显示收费管理流程页面
	function showCycleForward(){
 		var url = "${ctx}/charge_chargeVoucherPrintAction.do?method=chargeCycleForwardSmall";
		top.windowOpen(url, "chargeCycleForward", "", 340, 900);
    }
    function cycleForward(url){
   		window.location.href=url;
    }

	//设置当前选中行的房号Id及对应的acountId
	function setParameter(houseId,accountId){
		curHouseId = houseId ;
		curAccountId = accountId;
	}

	//设置查询条件至session中
	function mySubmit(){
		var url = "${ctx }/charge_preparePayAction.do?method=setSearchVO";
		var param = $("searchForm").serialize();
		new Ajax.Request(url,{method: 'post', parameters: param, onComplete: reloadFrame});
	}

	//刷新列表
	function reloadFrame(){
		window.frames("prePayOffsetListFrame").location.href = "${ctx }/charge_preparePayAction.do?method=initList";
	}

	//加载变更方案页面
	function modifyScheme(){
		if (curHouseId == null || curHouseId == ""){
			Alert("${key.nullParameterWarning}");
			return ;
		}
		var url = "${ctx }/charge_preparePayAction.do?method=initChangeChargeScheme&keyword="+curHouseId+"&accountId="+curAccountId+"&refreshIframe=prePayOffsetListFrame";
		top.windowOpen(url, "changeChargeScheme", "${key.modifyScheme}", 200, 400);
	}

	//抵冲确认
	function confirmOffset(){
		//document.getElementById('searchForm').action="${ctx}/charge_preparePayAction.do?method=goOffset";
		//document.forms[0].action="${ctx}/charge_preparePayAction.do?method=goOffset";
		//windowOpen
		//document.forms[0].submit();
		
		var url="${ctx}/charge_preparePayAction.do?method=goOffset";
		top.windowOpen(url, "offsetIfm", "", 240, 400);
	}

	//进行预交款抵冲
	function offset(){
		showLoading("${key.ongoingInfo}");
		url = "${ctx }/charge_preparePayAction.do?method=offset";
		new Ajax.Request(url,{
			method:'post',
			onSuccess:back
			})
	}
	function back(response){
		hiddenLoading();
		ajaxSubmitException(response.responseText);
		var msg = response.responseText;
		if (msg == 'success'){
			SuccessAlert("${key.success}");
			url = "${ctx }/charge_preparePayAction.do?method=initList";
			window.frames("prePayOffsetListFrame").location.href =url ;
		}
	}

</script>

</head>
<body  style="overflow: auto;">
<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
	  <td width="46" height="47" align="center" valign="middle" id="pageNav_leftimg"><img src="${ctx}/images/ico_charge_yjdc.gif" align="middle"/></td>
      <td id="navWord"><span class="page_title">${key.prePayOffse}</span></td>
      <td width="212" class="pageNav_right"><a href="#" style="CURSOR: hand;" onFocus="this.blur()" onClick="showCycleForward();"><img src="${ctx}/images/charage_buzhou.gif" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:showFull_in();" onclick=""><img id="full_image"  src="${ctx}/images/ico_fullscreen.gif" border="0"/></a>
	</tr>
  </table>
</div>

<div class="container">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td>
          <table width="100%" border="0" cellpadding="0" cellspacing="0"    class="bg_search" >
            <tr>
              <td >
      <form id="searchForm" name="searchForm" action="">
			<table border="0" cellpadding="0" cellspacing="2" class="tab_search2" order="0" >
              <tr>
                <td class="td_search">${key.building }：</td>
                <td class="td_search">
	                <pms:unitedSelect
						name="buildingId"
						id="buildingId"
						selectText="${key.choose }"
						dataList="${buildings}"
						optionLabel="name"
						optionValue="keyword"
						style="width: 110px">
					</pms:unitedSelect>
                </td>
                <td class="td_search">${key.houseName }：</td>
                <td class="td_search"><input name="houseName" type="text" class="inputtext" value=" " size="16"></td>
                <td class="td_search">${key.ownerNames }：</td>
                <td class="td_search"><input name="ownerNames" type="text" class="inputtext" size="16"></td>
                <td class="td_search">${key.prePayScheme }：</td>
                <td class="td_search">
                	<pms:unitedSelect
                		id="prePaySchId"
                		name="prePaySchId"
                		dataList="${prePaySchs}"
                		selectText="${key.choose }"
                		optionLabel="schemeName"
                		optionValue="prePaySchId"
                		style="width: 110px">
                	</pms:unitedSelect>
                </td>
				<td class="td_search">
				<table border="0" cellpadding="0" cellspacing="0" >
                   <tr>
                     <td class="buttonOffLeft" id="btn1_11"></td>
                     <td class="buttonOffMiddle" id="btn1_12" onclick="mySubmit();" onblur="btn_change(1)" onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)"><img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle">${key.search }</td>
                     <td class="buttonOffRight" id="btn1_13"></td>
                   </tr>
                </table></td>
              </tr>
            </table>
     </form>
			</td>
			</tr>
		</table>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"  >
            <tr>
              <td class="bg_toolBar">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="35%" align="right">
                    <table border="0" cellpadding="0" cellspacing="0" id="ico1">
                      <tr>
                      <pms:AuthTag authName="charge_preparePayAction.do?method=changeChargeScheme">
						<td class="toolbarico"><a href="#" onClick="modifyScheme();" onFocus="this.blur()"><img src="${ctx}/images/ico_worktable_charge.gif" alt="${key.modifyScheme }" width="16" height="16"  border="0" align="absbottom" />&nbsp;${key.modifyScheme }</a></td>
						</pms:AuthTag>
						<pms:AuthTag authName="charge_preparePayAction.do?method=initOngoing">
					 <td class="toolbar_line">|</td>
						<td class="toolbarico"><a href="#" onclick="confirmOffset();" onFocus="this.blur()"><img src="${ctx}/images/ico_charge_yjdc_dc.gif" alt="${key.offset }" width="16" height="16"  border="0" align="absbottom" />&nbsp;${key.offset }</a></td>
					 </pms:AuthTag>
					 </tr>
                    </table></td>
                  </tr>
              </table></td>
            </tr>
            <tr><td valign="top">
              	 	<iframe name="prePayOffsetListFrame"  id="prePayOffsetListFrame"  src="${ctx }/charge_preparePayAction.do?method=initList&isFirst=true"  frameborder="0" border="0"  width="100%" scrolling="auto"></iframe>
              	</td>
            </tr>
        </table>
    </tr>
  </table>
</div>
</body>
</html>

